//
//  CMUTransitionSegue.m
//  aaa
//
//  Created by Liuyi Sun on 9/30/12.
//  Copyright (c) 2012 CMU. All rights reserved.
//

#import "CMUTransitionSegue.h"
#import "CMUAppDelegate.h"
#import <UIKit/UIKit.h>

@implementation CMUTransitionSegue
- (void) perform {
    CMUAppDelegate *appDelegate = (CMUAppDelegate *)([[UIApplication sharedApplication] delegate]);
    UIViewController *srcViewController = (UIViewController *) self.sourceViewController;
    UIViewController *destViewController = (UIViewController *) self.destinationViewController;
    [UIView transitionFromView:srcViewController.view toView:destViewController.view duration:0.8 options:UIViewAnimationOptionTransitionFlipFromRight completion:^(BOOL finished){
        appDelegate.window.rootViewController=destViewController;
    }];
    
}

@end
